<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="div1" >
			<h1>jdkjsodjf</h1>
			<p>sdfaj<span>ddd</span></p>
			<ul>
				<li>jj</li>
				<li>jj</li>
				<li>jj</li>
				<li>jj</li>
			</ul>
		</div>
		<script type="text/javascript">
			var div1=document.getElementById("div1");
			console.log(div1.parentNode);
			//父节点
			
			console.log(div1.firstElementChild);
			//第一个结点
			console.log(div1.lastElementChild);
			//最后一个结点
			console.log(div1.childNodes[3].childNodes[1].innerHTML);
			
			console.log(div1.children[2])
			//获取全部子节点
			
		</script>
	</body>
</html>
